#define _CRT_SECURE_NO_WARNINGS 1


//int main()
//{
//    double a1, a2, b1, b2;
//    scanf("%lf %lf %lf %lf", &a1, &b1, &a2, &b2);
//    char ch[5] = { '+','-','*','/' };
//    double real[4] = { 0 };
//    double image[4] = { 0 };
//    real[0] = a1 + a2;
//    real[1] = a1 - a2;
//    real[2] = a1 * a2 - b1 * b2;
//    real[3] = (a1 * a2 + b1 * b2) / (pow(a2, 2) + pow(b2, 2));
//
//    image[0] = b1 + b2;
//    image[1] = b1 - b2;
//    image[2] = b1 * a2 + b2 * a1;
//    image[3] = (a2 * b1 - a1 * b2) / (pow(a2, 2) + pow(b2, 2));
//
//    for (int i = 0; i < 4; i++)
//    {
//        if (fabs(real[i]) < 0.05 && fabs(image[i]) < 0.05)
//            printf("(%.1f%+.1fi) %c (%.1f%+.1fi) = 0.0\n", a1, b1, ch[i], a2, b2);
//        else if (fabs(real[i]) < 0.05)
//            printf("(%.1f%+.1fi) %c (%.1f%+.1fi) = %.1fi\n", a1, b1, ch[i], a2, b2, image[i]);
//        else if (fabs(image[i]) < 0.05)
//            printf("(%.1f%+.1fi) %c (%.1f%+.1fi) = %.1f\n", a1, b1, ch[i], a2, b2, real[i]);
//        else
//            printf("(%.1f%+.1fi) %c (%.1f%+.1fi) = %.1f%+.1fi\n", a1, b1, ch[i], a2, b2, real[i], image[i]);
//    }
//}

typedef struct
{
    int numerator;
    int denominator;
}Fraction;

int gcd(int ret1, int ret2)
{
    int tmp;
    while (tmp = ret1 % ret2)
    {
        ret1 = ret2;
        ret2 = tmp;
    }
    return ret2;
}

//int main()
//{
//    int N;
//    scanf("%d", &N);
//    Fraction fraction[100];
//    for (int i = 0; i < N; i++)
//    {
//        scanf("%d/%d", &fraction[i].numerator, &fraction[i].denominator);
//    }
//    int num;
//    int numerator = fraction[0].numerator;
//    int denominator = fraction[0].denominator;
//    for (int i = 1; i < N; i++)
//    {
//        numerator = numerator * fraction[i].denominator + denominator * fraction[i].numerator;
//        denominator *= fraction[i].denominator;
//        num = gcd(numerator, denominator);
//        numerator /= num;
//        denominator /= num;
//    }
//    denominator *= N;
//    num = gcd(numerator, denominator);
//    numerator /= num;
//    denominator /= num;
//    if (denominator == 1)
//        printf("%d", numerator);
//    else
//        printf("%d/%d", numerator, denominator);
//}

int main()
{
    int a1, b1, a2, b2;
    scanf("%d/%d %d/%d", &a1, &b1, &a2, &b2);
    int ret1 = a1 * b2 + a2 * b1;
    int ret2 = b1 * b2;
    int a = ret1;
    int b = ret2;
    int tmp = 0;
    if (ret2 > ret1)
    {
        tmp = ret1;
        ret1 = ret2;
        ret2 = tmp;
    }
    while (tmp = ret2 % ret1)
    {
        ret2 = ret1;
        ret1 = tmp;
    }
    a /= ret1;
    b /= ret1;
    if (a % b == 0)
        printf("%d", a);
    else
        printf("%d/%d", a, b);
}